package sg.edu.nus.iss;

/**
 * 
 * @author Xu Guoneng
 *
 */
public class Package implements Comparable<Package>{

	private int id;
	private double weight;
	private int categoryCd;
	
	public Package(int id, double weight, int categoryCd) {
		super();
		this.id = id;
		this.weight = weight;
		this.categoryCd = categoryCd;
	}

	public int getCategoryCd() {
		return categoryCd;
	}

	public int getId() {
		return id;
	}

	public double getWeight() {
		return weight;
	}
	
	public String toString(){
		return "Package " + id + "\t" + "weight = " + weight + " category = " + categoryCd;
	}
	
	public int compareTo(Package otherPackage){
		if(this.getWeight() > otherPackage.getWeight())    
		     return 1;
		else if (this.getWeight() < otherPackage.getWeight())
		     return -1;
		else
		     return 0;
	}

}
